<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       .wrap{
           position: relative;
           border:sold 1px red;
           width:1000px;
           height: 1000px;
       }
       #box{
           position:absolute;
           left: 0;
           top: 0;
           width: 100px;
           height: 50px;
           background-color: blue;
           animation: box 5s linear infinite;

       }
       @keyframes box{
           0% {left: 0;top: 0;}
           25%{left: 500px;top: 0;}
           50%{left: 500px;top: 500px;}
           75%{left: 0;top: 500px;}
           100%{left: 0;top: 0;}
       }
    </style>
</head>
<body>
    <div class="wrap">
        <div id="box"></div>
    </div>
</body>
</html>